package com.smbms.controller;

import com.smbms.pojo.Provider;
import com.smbms.service.ProviderService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/provider")
public class ProviderController {
    @Resource
    private ProviderService providerService;

    @ResponseBody
    @RequestMapping("/getProviderList")
    public Object getProviderList(){
        Map<String,Object> result=new HashMap<>();

        List<Provider> providerList=providerService.getProviderList();

        result.put("flag",true);
        result.put("msg","查询供应商列表success");
        result.put("data",providerList);

        return result;
    }
}
